/*
 * FunnelNode.cpp
 *
 *  Created on: 16/08/2012
 *      Author: Aeradon
 */

#include "../include/FunnelNode.h"

//default constructor - initializes all
//member variables to default values
FunnelNode::FunnelNode()
{
	pLeft = NULL;
	pRight = NULL;
	position.setXY(PFR_MIN_FLOAT, PFR_MIN_FLOAT);
}

//constructor - initializes the point member
//variable to the coordinates passed
FunnelNode::FunnelNode(float x, float y)
{
	pLeft = NULL;
	pRight = NULL;
	position.setXY(x, y);
}

//constructor - initializes the point member
//variable to the one passed
FunnelNode::FunnelNode(const Point<T>& point)
{
	pLeft = NULL;
	pRight = NULL;
	position.setXY(point.x, point.y);
}

//mutator for the left pointer
void FunnelNode::Left(FunnelNode *left)
{
	pLeft = left;
}

//mutator for the right pointer
void FunnelNode::Right(FunnelNode *right)
{
	pRight = right;
}

//accessor for the left pointer
FunnelNode *FunnelNode::Left()
{
	return pLeft;
}

//accessor for the right pointer
FunnelNode *FunnelNode::Right()
{
	return pRight;
}

//mutator for the point
void FunnelNode::SetPoint(const Point<T>& point)
{
	position.setXY(point.x, point.y);
}

//mutator for the point's coordinates
void FunnelNode::SetPoint(float x, float y)
{
	position.setXY(x, y);
}

//accessor for the point
Point<FunnelNode::T> FunnelNode::GetPoint()
{
	return Point<T>(position);
}

//accessor for the point's X coordinate
float FunnelNode::X()
{
	return position.x;
}

//accessor for the point's Y coordinate
float FunnelNode::Y()
{
	return position.y;
}

